﻿using System.Runtime.InteropServices;
using UnityEngine;

namespace Sliver.Core
{
    [StructLayout(LayoutKind.Sequential)]
    public class VehicleRawInfo
    {
        public int id;
        public int status;
        public Vector2 position;
        public Vector2 direction;
        public float speed;
        public float distance;
    }

    public class OutputVehicleInfo
    {
        public int id;
        public int status;
        public double px;
        public double py;
        public double dx;
        public double dy;
        public float s;
        public float d;

        public OutputVehicleInfo()
        {
        }

        public OutputVehicleInfo(VehicleRawInfo info)
        {
            id = info.id;
            status = info.status;
            px = info.position.x;
            py = info.position.y;
            dx = info.direction.x;
            dy = info.direction.y;
            s = info.speed;
            d = info.distance;
        }
    }

    [StructLayout(LayoutKind.Sequential)]
    public class VehicleCollision
    {
        public Vector2 point;
        public int[] vehicles;
    }
}
